home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / LPTPORT.ASM < prev    next >
Assembly Source File  |  1986-02-05  |  1KB  |  30 lines

  1. ;title    LPTPORT.ASM - Switch Printer Ports Between LPT1: and LPT2:
  2. ;
  3. ; (C) Copyright 1984, Dickinson Associates Inc.
  4. ;
  5. ROM_BIOS_DATA    segment at 40h        ; Low Memory "BIOS" Parameters at 40H
  6.     org    8h            ; Printer port addresses are at byte 8
  7.     PRINTER_BASE    dw  4 dup(?)    ; Four words for Printer Port
  8.                     ; I/O Address Locations
  9. ROM_BIOS_DATA    ends            ; End of data segment
  10. ;
  11. CODE_SEG    segment para 'code'
  12. ;
  13.     assume    ds:ROM_BIOS_DATA, cs:CODE_SEG, ss:NOTHING, es:NOTHING
  14.     org    100h            ; .COM format program
  15. ;
  16. BEGIN:
  17.     mov    ax,ROM_BIOS_DATA    ; Make ROM_BIOS_DATA addressable
  18.     mov    ds,ax            ; via DS register.
  19. ;
  20.     mov    ax,PRINTER_BASE[0]    ; Move LPT1: port address to AX
  21.     mov    bx,PRINTER_BASE[2]    ; Move LPT2: port address to BX
  22.     mov    PRINTER_BASE[0],bx    ; Switch the port addresses around
  23.     mov    PRINTER_BASE[2],ax    ; by moving them back in reverse order.
  24. ;
  25.     ret                ; Back to PC-DOS
  26. ;
  27. CODE_SEG    ends            ; End of code segment
  28. ;
  29.     end    BEGIN            ; End of program
  30.